﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace GameProject.Models
{
    public class GameInstance
    {
		public int ID { get; set; }
		
		[DisplayName("Nafn")]
		public string Name { get; set; }
		
		public GameType GameType { get; set; }
		
		public List<Piece> PieceSnakes { get; set; }

        public string UserName { get; set; }
        
        public Grid Grid { get; set; }

		[DisplayName("Fjöldi leikmanna í leik")]
		public int CurrentNumberOfPlayers { get; set; }

		[Range(2,6, ErrorMessage="Fjöldi leikmanna verður að vera á milli 2 og 6")]
		[Required(ErrorMessage = "Vinsamlegast sláðu inn fjölda leikmanna")]
		[DisplayName("Fjöldi mögulegra leikmanna")]
		public int ExpectedNumberOfPlayers { get; set; }
		
		public GameStatus Status { get; set; }

		public bool PlayAgainstComputer { get; set; }

		public GameInstance()
		{
			PieceSnakes = new List<Piece>();
		}
    }
}